package 二叉树的递归遍历.前序遍历;

import java.util.List;

public class Test1 {
    public static void main(String[] args) {
        TreeNode root = new TreeNode(1);
        root.left = new TreeNode(2);
        root.right = new TreeNode(3);
        root.left.left = new TreeNode(4);
        root.left.right = new TreeNode(5);

        Solution1 solution = new Solution1();
        List<Integer> result = solution.preorderTraversal(root);
        System.out.println(result); // Expected output: [1, 2, 4, 5, 3]
    }
}